set hive.exec.mode.local.auto=true;
-- 基础地域表
create table if not exists ods_nshop.ods_01_base_area
(
    id            int COMMENT 'id标识',
    area_code     string COMMENT '省份编码',
    province_name string COMMENT '省份名称',
    iso           string COMMENT 'ISO编码'
) row format delimited fields terminated by ','
    stored as TextFile
    location '/data/nshop/ods/ods_01_base_area/';
alter table ods_nshop.ods_01_base_area set tblproperties ('comment'='基础地域表');

-- 全国各省浏览量
create external table if not exists ads_nshop.ads_nshop_customer
(
    customer_gender  string COMMENT '性别：1男 0女',
    os               string comment '手机系统',
    customer_natives string COMMENT '所在地区ISO编码',
    user_view_count  int comment '每个用户浏览次数'
) partitioned by (bdp_day string)
    row format delimited fields terminated by ','
    stored as TextFile
    location '/data/nshop/ads/operation/ads_nshop_customer/';
alter table ads_nshop.ads_nshop_customer set tblproperties ('comment'='全国各省浏览量');

-- 指标统计表
create external table if not exists ads_nshop.ads_nshop_customer
(
    customer_gender  string COMMENT '性别：1男 0女',
    os               string comment '手机系统',
    customer_natives string COMMENT '所在地区ISO编码',
    user_view_count  int comment '每个用户浏览次数'
) partitioned by (bdp_day string)
    row format delimited fields terminated by ','
    stored as TextFile
    location '/data/nshop/ads/operation/ads_nshop_customer/';
alter table ads_nshop.ads_nshop_customer set tblproperties ('comment'='指标统计表');


